﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "ScalableFloat.h"
#include "Engine/DataAsset.h"
#include "CharacterClassInfo.generated.h"

class UGameplayAbility;
class UGameplayEffect;

/** 角色职业类型的枚举 */
UENUM(BlueprintType)
enum class ERoleClass : uint8
{
	/* 法师 */
	Elementalist,

	/* 战士 */
	Warrior,

	/* 游侠 */
	Ranger,
};

/**
 * 角色类的默认数据
 */
USTRUCT()
struct FCharacterClassDefaultInfo
{
	GENERATED_BODY()

	/** 主要属性初始化GE */
	UPROPERTY(EditDefaultsOnly, Category = "FCharacterClassDefaultInfo")
	TSubclassOf<UGameplayEffect> PrimaryAttributes;

	/** 击杀奖赏经验 */
	UPROPERTY(EditDefaultsOnly, Category = "FCharacterClassDefaultInfo")
	FScalableFloat XPReward;

	/** 开始拥有的能力 */
	UPROPERTY(EditDefaultsOnly, Category = "FCharacterClassDefaultInfo")
	TArray<TSubclassOf<UGameplayAbility>> StartupAbilities;
};

/**
 * 不同职业对应的初始化数据
 */
UCLASS()
class AURA_API UCharacterClassInfo : public UDataAsset
{
	GENERATED_BODY()

public:

	/** 通过职业枚举获取对应角色初始化类信息 */
	FCharacterClassDefaultInfo GetClassDefaultInfo(ERoleClass RoleClass) const;

	/** 角色职业类型对应的初始化类信息Map */
	UPROPERTY(EditDefaultsOnly, Category = "Class Defaults")
	TMap<ERoleClass, FCharacterClassDefaultInfo> RoleClassInformation;

	/** 通用的次要属性初始化类信息 */
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults")
	TSubclassOf<UGameplayEffect> SecondaryAttributes;

	/** 通用的 vital 属性初始化类信息 */
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults")
	TSubclassOf<UGameplayEffect> VitalAttributes;

	/** 通用的技能 */
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults")
	TArray<TSubclassOf<UGameplayAbility>> CommonAbilities;

	/** 伤害计算系数曲线表 */
	UPROPERTY(EditDefaultsOnly, Category = "Common Class Defaults|Damage")
	TObjectPtr<UCurveTable> DamageCalculationCoefficients;
};
